<template>
  <div class="contentBox">
    <img src="@/assets/image/mobile-bg.png" alt="" width="100%" height="75" class="objectFitCover">
    <div class="cardBox">
      <p class="title">防伪信息</p>
      <div v-if="dataInfo.dataStatus==='4'" class="invalidBox">
        <span class="iconfont iconshibai"></span>
        <p>该报告信息调整中: <span class="colorDanger fontSize28 marginLeft20">信息已作废</span></p>
      </div>
      <ul v-else class="detailUl">
        <li>
          <span class="leftName">防伪编码:</span><span>{{ dataInfo.antiCounterfeitingCoding}}</span>
        </li>
        <li>
          <span class="leftName">防伪码状态:</span><span>{{ handleStatus() }}</span>
        </li>
        <li>
          <span class="leftName">报告内容:</span>
          <p class="color777">
            <span>{{ dataInfo.customerName }}</span>
            <span v-if="dataInfo.reportType !== '专项审计' && dataInfo.reportType !== '验资' && dataInfo.reportType !== '其他'">{{ dataInfo.auditYear }}年</span>
            <span>{{ dataInfo.titleSuffixName }}</span>
          </p>
        </li>
        <li>
          <span class="leftName">报备类型:</span><span>{{ dataInfo.reportType}}</span>
        </li>
        <li>
          <span class="leftName">报告文号:</span><span>{{ dataInfo.reportNo }}</span>
        </li>
        <li>
          <span class="leftName">报告日期:</span><span>{{ dataInfo.reportTime}}</span>
        </li>
        <li>
          <span class="leftName">意见类型:</span><span>{{ dataInfo.opinionType }}</span>
        </li>
        <li>
          <span class="leftName">备注说明:</span><span>{{ dataInfo.officeRemarks }}</span>
        </li>
        <li>
          <span class="leftName">事务所名称:</span><span>{{ dataInfo.firmName}}</span>
        </li>
        <li v-for="(item,index) in dataInfo.assuranceBusinessDataRegisterSignatures" :key="index">
          <span class="leftName">签字注册会计师{{ index+1}}: </span>
          <p class="color777">
            <span class="displayBlock">{{item.registrantName}}</span>
            <span class="displayBlock">(证书号：{{item.registrationCertificateNo}})</span>
          </p>
        </li>
        <li>
          <span class="leftName">事务所地址</span><span>{{ office.placeOfBusiness }}</span>
        </li>
        <li>
          <span class="leftName">事务所电话</span><span>{{ office.contactNumber }}</span>
        </li>

      </ul>
    </div>
    <p class="pageFooter">
      <span>
        业务报告使用防伪编码仅说明该业务报告是由依法批准设立的会计事务所出具，
      业务报告的法律责任主体是出具报告的会计师事务所及签字注册会计师。
      </span>
      <span>
        报告防伪信息查询网址：<a href="http://www.shcpa.org.cn">http://www.shcpa.org.cn</a>
      </span>
      <span>上海市注册会计师协会版权所有</span>
    </p>
  </div>
</template>

<script>
  import { getAntiCode } from '@/api/system/assurance'

export default {
  name: "CodeDetail",
  data() {
    return {
      antiCounterfeitingCoding: this.$route.query.antiCounterfeitingCoding,
      dataInfo: {},
      office: {}
    };
  },
  created() {
    if(this.antiCounterfeitingCoding){
      this.getData(this.antiCounterfeitingCoding)
    }
  },
  methods: {
    handleStatus(){
      let dataInfo = this.dataInfo;
      if(dataInfo.dataStatus==='4'){
        return '已作废';
      }else if(dataInfo.applyForFinancialRefund==='1'){
        return '修改中';
      }else if(dataInfo.dataStatus==='9'){
        return '修改中';
      }else if(dataInfo.dataStatus==='2'){
        return '修改中';
      }else if(dataInfo.dataStatus==='6'){
        return '修改中';
      }else if(dataInfo.dataStatus==='0'){
        return '不予报备';
      }else{
        return '正常';
      }
    },
    getData(antiCounterfeitingCoding) {
      getAntiCode(antiCounterfeitingCoding).then(
        response=> {
          let resCode = response.data.code;
          if(resCode!==200){
            this.$confirm(response.data.msg, '提示', {
              confirmButtonText: '返回',
              showClose: false,
              showCancelButton: false,
              closeOnClickModal: false,
              type: 'error'
            }).then(() => {
              this.$router.go(-1)
            });
          }else{
            this.dataInfo = response.data.data;
            this.office = response.data.office;

            let reportType = this.dataInfo.reportType
            if(reportType === '上市公司审计' ||
              reportType === '一般企业审计' ||
              reportType === '国有大型企业审计' ||
              reportType === '事业单位审计'||
              reportType === '上市公司新三板企业审计') {
              this.dataInfo.titleSuffixName = '财务报表审计报告'
            }else if(reportType === '上市公司内控鉴证') {
              this.dataInfo.titleSuffixName = '内部控制审计报告'
            }else if(reportType === '专项审计') {
              this.dataInfo.titleSuffixName = '专项审计报告'
            }else if(reportType === '验资') {
              this.dataInfo.titleSuffixName = '验资报告'
            }else if(reportType === '其他') {
              this.dataInfo.titleSuffixName = '非鉴证业务报告'
            }
          }
      })
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.contentBox {
  background: #0533f7;
  .pageTitle{
    margin: 30px;
    color: #333;
    font-weight: 500;
    font-size: 20px;
    text-align: center;
  }
  .pageFooter{
    padding: 20px;
    font-size: 13px;
    color: rgba(255,255,255,.8);
    text-align: center;
    span{
      display: block;
      margin-top: 10px;
      line-height: 20px;
    }
  }
  .cardBox{
    width: 1100px;
    margin: 20px auto 0 auto;
    padding-top: 15px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,.2);
    overflow: hidden;
    .title{
      padding-left: 10px;
      border-left: 4px solid #0533f7;
      font-size: 16px;
      letter-spacing: 4px;
      font-weight: 500;
    }
    .detailUl{
      li{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 15px;
        font-size: 14px;
        line-height: 22px;
        .leftName{ flex-shrink: 0; margin-right: 16px; width: 75px; color: #555; text-align: right; }
        span:last-child{ color: #777; text-align: left; }
      }
      li:nth-child(2n){
        background: #f1f4f8;
      }
    }
    .invalidBox{
      height: 300px;
      text-align: center;
      font-size: 20px;
      .iconshibai{
        display: inline-block;
        margin: 40px 0;
        font-size: 90px;
        color: #e85252;
      }
    }
  }
}
  @media screen and (max-width: 768px)
  {
  .contentBox{
    .pageHeader{
      height: 76px;
      background: url("../../../assets/image/mobile-bg.png") no-repeat 0 0;
      background-size: cover;
    }
    .pageTitle{ display: none;}
    .cardBox{
      width: calc(100% - 40px);
    }
    .pageFooter{
      text-align: left;
    }
  }
}



</style>
